//
// Created by Administrator on 2023/11/24.
//
#include "bits/stdc++.h"

using namespace std;

const int N = 50;
int dp[N][N];
int a[N];

int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
    }
    dp[0][0] = 1;//注意初始条件
    for (int i = 1; i <= n; ++i) {
        //容量为0时也是一种特殊情况【什么都不选】
        for (int j = 0; j <= 40; ++j) {
            if (a[i] > j)
                dp[i][j] = dp[i - 1][j];
            else {
                dp[i][j] = dp[i - 1][j] + dp[i - 1][j - a[i]];//取法就不是最大了 是和
            }
        }
    }
    cout << dp[n][40];
}